/* Features Section - 3D Carousel Styles */

.features-section {
    padding: 80px 0;
    background: linear-gradient(180deg, #f8fafc 0%, #fff 100%);
    position: relative;
    overflow: hidden;
    min-height: 600px;
}

.features-section::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(44, 95, 124, 0.05) 0%, transparent 70%);
    border-radius: 50%;
}

.features-section::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -10%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(193, 39, 45, 0.05) 0%, transparent 70%);
    border-radius: 50%;
}

.features-container {
    max-width: 100%;
    margin: 0 auto;
    padding: 0 1rem;
    position: relative;
    z-index: 1;
}

/* Header */
.features-header {
    text-align: center;
    margin-bottom: 3rem;
}

.features-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0;
}

/* 3D Carousel */
.carousel-wrapper {
    position: relative;
    width: 100%;
    height: 420px;
    perspective: 1200px;
    margin: 0 auto;
}

.carousel-track {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Carousel Card */
.carousel-card {
    position: absolute;
    width: 320px;
    height: 350px;
    left: 50%;
    top: 50%;
    margin-left: -160px;
    margin-top: -175px;
    background: #fff;
    border-radius: 24px;
    padding: 2rem;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    backface-visibility: hidden;
    transform-style: preserve-3d;
    cursor: grab;
    user-select: none;
}

.carousel-card.active {
    transform: translateX(0) translateZ(100px) scale(1);
    opacity: 1;
    z-index: 10;
}

.carousel-card.prev {
    transform: translateX(120%) translateZ(-50px) scale(0.85) rotateY(15deg);
    opacity: 0.6;
    z-index: 5;
}

.carousel-card.next {
    transform: translateX(-120%) translateZ(-50px) scale(0.85) rotateY(-15deg);
    opacity: 0.6;
    z-index: 5;
}

.carousel-card.hidden-left {
    transform: translateX(200%) translateZ(-150px) scale(0.7) rotateY(30deg);
    opacity: 0;
    z-index: 1;
    pointer-events: none;
}

.carousel-card.hidden-right {
    transform: translateX(-200%) translateZ(-150px) scale(0.7) rotateY(-30deg);
    opacity: 0;
    z-index: 1;
    pointer-events: none;
}

/* Icon */
.feature-icon-wrapper {
    position: relative;
    display: inline-block;
    margin-bottom: 1.5rem;
}

.feature-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary-blue, #2c5f7c) 0%, #1e4a5f 100%);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.4s ease;
    position: relative;
    z-index: 1;
}

.carousel-card:nth-child(2) .feature-icon,
.carousel-card:nth-child(4) .feature-icon,
.carousel-card:nth-child(6) .feature-icon {
    background: linear-gradient(135deg, #C1272D 0%, #a01f24 100%);
}

.feature-icon i {
    font-size: 2rem;
    color: #fff;
}

.feature-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(1);
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, rgba(44, 95, 124, 0.3) 0%, rgba(30, 74, 95, 0.3) 100%);
    border-radius: 20px;
    opacity: 0;
    transition: all 0.4s ease;
    z-index: 0;
    filter: blur(15px);
}

.carousel-card:nth-child(2) .feature-glow,
.carousel-card:nth-child(4) .feature-glow,
.carousel-card:nth-child(6) .feature-glow {
    background: linear-gradient(135deg, rgba(193, 39, 45, 0.3) 0%, rgba(160, 31, 36, 0.3) 100%);
}

.carousel-card.active .feature-glow {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.3);
}

/* Text */
.feature-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1a1a2e;
    margin-bottom: 0.75rem;
}

.feature-desc {
    font-size: 0.95rem;
    color: #666;
    line-height: 1.6;
    margin: 0;
}





/* Clouds Animation */
.features-clouds {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
}

.cloud {
    position: absolute;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.8) 0%, rgba(240, 240, 240, 0.6) 100%);
    border-radius: 100px;
    filter: blur(2px);
    opacity: 0.6;
}

.cloud::before,
.cloud::after {
    content: '';
    position: absolute;
    background: inherit;
    border-radius: 50%;
}

.cloud-1 {
    width: 200px;
    height: 60px;
    top: 5%;
    right: -250px;
    animation: cloudMoveRTL 20s linear infinite;
}
.cloud-1::before { width: 80px; height: 80px; top: -40px; left: 30px; }
.cloud-1::after { width: 60px; height: 60px; top: -30px; left: 90px; }

.cloud-2 {
    width: 150px;
    height: 45px;
    top: 25%;
    right: -200px;
    animation: cloudMoveRTL 25s linear infinite;
    animation-delay: -5s;
}
.cloud-2::before { width: 60px; height: 60px; top: -30px; left: 20px; }
.cloud-2::after { width: 45px; height: 45px; top: -22px; left: 70px; }

.cloud-3 {
    width: 180px;
    height: 50px;
    top: 45%;
    right: -220px;
    animation: cloudMoveRTL 22s linear infinite;
    animation-delay: -10s;
}
.cloud-3::before { width: 70px; height: 70px; top: -35px; left: 25px; }
.cloud-3::after { width: 50px; height: 50px; top: -25px; left: 85px; }

.cloud-4 {
    width: 160px;
    height: 48px;
    top: 60%;
    right: -200px;
    animation: cloudMoveRTL 28s linear infinite;
    animation-delay: -15s;
}
.cloud-4::before { width: 65px; height: 65px; top: -32px; left: 22px; }
.cloud-4::after { width: 48px; height: 48px; top: -24px; left: 75px; }

.cloud-5 {
    width: 140px;
    height: 42px;
    top: 75%;
    right: -180px;
    animation: cloudMoveRTL 24s linear infinite;
    animation-delay: -8s;
}
.cloud-5::before { width: 55px; height: 55px; top: -28px; left: 18px; }
.cloud-5::after { width: 42px; height: 42px; top: -21px; left: 65px; }

.cloud-6 {
    width: 190px;
    height: 55px;
    top: 90%;
    right: -230px;
    animation: cloudMoveRTL 26s linear infinite;
    animation-delay: -18s;
}
.cloud-6::before { width: 75px; height: 75px; top: -38px; left: 28px; }
.cloud-6::after { width: 55px; height: 55px; top: -28px; left: 88px; }

@keyframes cloudMoveRTL {
    0% { right: -250px; }
    100% { right: 100%; }
}

/* Sparkles Animation */
.features-sparkles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.sparkle {
    position: absolute;
    width: 8px;
    height: 8px;
    background: radial-gradient(circle, #ffd700 0%, #ffec8b 50%, transparent 70%);
    border-radius: 50%;
    animation: sparkle 3s ease-in-out infinite;
    box-shadow: 0 0 10px #ffd700, 0 0 20px #ffd700, 0 0 30px #ffec8b;
}

.sparkle-1 { top: 8%; left: 5%; animation-delay: 0s; }
.sparkle-2 { top: 15%; right: 10%; animation-delay: 0.3s; }
.sparkle-3 { top: 25%; left: 15%; animation-delay: 0.6s; }
.sparkle-4 { top: 35%; right: 5%; animation-delay: 0.9s; }
.sparkle-5 { top: 45%; left: 8%; animation-delay: 1.2s; }
.sparkle-6 { top: 55%; right: 12%; animation-delay: 1.5s; }
.sparkle-7 { top: 65%; left: 3%; animation-delay: 1.8s; }
.sparkle-8 { top: 75%; right: 8%; animation-delay: 2.1s; }
.sparkle-9 { top: 85%; left: 12%; animation-delay: 2.4s; }
.sparkle-10 { top: 92%; right: 15%; animation-delay: 2.7s; }

@keyframes sparkle {
    0%, 100% {
        opacity: 0;
        transform: scale(0.5);
    }
    50% {
        opacity: 1;
        transform: scale(1.2);
    }
}

/* Responsive */
@media (max-width: 992px) {
    .carousel-wrapper {
        height: 380px;
    }
    
    .carousel-card {
        width: 280px;
        height: 320px;
        margin-left: -140px;
        margin-top: -160px;
        padding: 1.5rem;
    }
    
    .carousel-card.prev {
        transform: translateX(100%) translateZ(-50px) scale(0.8) rotateY(15deg);
    }
    
    .carousel-card.next {
        transform: translateX(-100%) translateZ(-50px) scale(0.8) rotateY(-15deg);
    }
    
    .features-title {
        font-size: 2rem;
    }
}

@media (max-width: 768px) {
    .features-section {
        padding: 60px 0;
        min-height: 500px;
    }
    
    .carousel-wrapper {
        height: 350px;
    }
    
    .carousel-card {
        width: 260px;
        height: 300px;
        margin-left: -130px;
        margin-top: -150px;
    }
    
    .carousel-card.prev,
    .carousel-card.next {
        opacity: 0.4;
    }
    
    .carousel-card.prev {
        transform: translateX(80%) translateZ(-80px) scale(0.75) rotateY(20deg);
    }
    
    .carousel-card.next {
        transform: translateX(-80%) translateZ(-80px) scale(0.75) rotateY(-20deg);
    }
    
    .features-header {
        margin-bottom: 2rem;
    }
    
    .features-title {
        font-size: 1.8rem;
    }
    
    .feature-icon {
        width: 70px;
        height: 70px;
    }
    
    .feature-icon i {
        font-size: 1.7rem;
    }
    
    .cloud { display: none; }
    .sparkle { width: 6px; height: 6px; }
}

@media (max-width: 480px) {
    .features-container {
        padding: 0 1rem;
    }
    
    .carousel-wrapper {
        height: 320px;
    }
    
    .carousel-card {
        width: 240px;
        height: 280px;
        margin-left: -120px;
        margin-top: -140px;
        padding: 1.25rem;
    }
    
    .features-title {
        font-size: 1.5rem;
    }
    
    .feature-title {
        font-size: 1.1rem;
    }
    
    .feature-desc {
        font-size: 0.85rem;
    }
    
    .feature-icon {
        width: 60px;
        height: 60px;
        border-radius: 16px;
    }
    
    .feature-icon i {
        font-size: 1.5rem;
    }
    
}

/* ===================================
   LTR (Left-to-Right) Styles
   =================================== */

html[dir="ltr"] .features-section::before {
    right: auto;
    left: -20%;
}

html[dir="ltr"] .features-section::after {
    left: auto;
    right: -10%;
}

/* LTR Clouds Animation */
html[dir="ltr"] .cloud-1,
html[dir="ltr"] .cloud-2,
html[dir="ltr"] .cloud-3,
html[dir="ltr"] .cloud-4,
html[dir="ltr"] .cloud-5,
html[dir="ltr"] .cloud-6 {
    right: auto;
    left: -250px;
    animation-name: cloudMoveLTR;
}

@keyframes cloudMoveLTR {
    0% { left: -250px; }
    100% { left: 100%; }
}

/* LTR Carousel Adjustments */
html[dir="ltr"] .carousel-card.prev {
    transform: translateX(-120%) translateZ(-50px) scale(0.85) rotateY(-15deg);
}

html[dir="ltr"] .carousel-card.next {
    transform: translateX(120%) translateZ(-50px) scale(0.85) rotateY(15deg);
}

html[dir="ltr"] .carousel-card.hidden-left {
    transform: translateX(-200%) translateZ(-150px) scale(0.7) rotateY(-30deg);
}

html[dir="ltr"] .carousel-card.hidden-right {
    transform: translateX(200%) translateZ(-150px) scale(0.7) rotateY(30deg);
}

@media (max-width: 992px) {
    html[dir="ltr"] .carousel-card.prev {
        transform: translateX(-100%) translateZ(-50px) scale(0.8) rotateY(-15deg);
    }
    
    html[dir="ltr"] .carousel-card.next {
        transform: translateX(100%) translateZ(-50px) scale(0.8) rotateY(15deg);
    }
}

@media (max-width: 768px) {
    html[dir="ltr"] .carousel-card.prev {
        transform: translateX(-80%) translateZ(-80px) scale(0.75) rotateY(-20deg);
    }
    
    html[dir="ltr"] .carousel-card.next {
        transform: translateX(80%) translateZ(-80px) scale(0.75) rotateY(20deg);
    }
}
